/*
* RT-Thread Secure
*
* Copyright (c) 2021, Shanghai Real-Thread Electronic Technology Co., Ltd.
*
* All rights reserved.
*/
#ifndef __DRV_CLK_H__
#define __DRV_CLK_H__

#include <rtthread.h>
#include <rtdevice.h>

int rockchip_hw_clk_init(void);
rt_clk_t *rt_clk_rk3568_composite_register(const char *name, const char *parents,
    rt_ubase_t mux_reg, rt_uint32_t mux_shift, rt_uint32_t mux_width,
    rt_ubase_t gate_reg, rt_uint32_t gate_shift, rt_uint32_t gate_invert,
    rt_ubase_t divider_reg, rt_uint32_t divider_shift, rt_uint32_t divider_width, rt_bool_t divider_onebased);
rt_err_t rt_clk_rk3568_composite_unregister(rt_clk_t *clk);
rt_clk_t *rt_clk_rk3568_frac_register(const char *name, const char *parent, rt_ubase_t frac_reg,
    rt_ubase_t gate_reg, rt_uint32_t shift, rt_bool_t invert);
rt_err_t rt_clk_rk3568_frac_unregister(rt_clk_t *clk);
rt_clk_t *rt_clk_rk3568_divider_register(const char *name, const char *parent, rt_ubase_t reg, rt_uint32_t shift,
    rt_uint32_t width, rt_bool_t onebased);
rt_err_t rt_clk_rk3568_divider_unregister(rt_clk_t *clk);
rt_clk_t *rt_clk_rk3568_gate_register(const char *name, const char *parent, rt_ubase_t reg, rt_uint32_t shift,
    rt_bool_t invert);
rt_err_t rt_clk_rk3568_gate_unregister(rt_clk_t *clk);
rt_clk_t *rt_clk_rk3568_mux_register(const char *name, const char *parents, rt_ubase_t reg,
    rt_uint32_t shift, rt_uint32_t width);
rt_err_t rt_clk_rk3568_mux_unregister(rt_clk_t *clk);
rt_clk_t *rt_clk_rk3568_pll_register(const char *name, const char *parent, int ch);
rt_err_t rt_clk_rk3568_pll_unregister(rt_clk_t *clk);

#endif /* __DRV_CLK_H__ */
